package liumengbaio.lolzhangyoubao.Activity.Activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.text.InputType;
import android.view.View;
import android.widget.EditText;

import liumengbaio.lolzhangyoubao.R;

/**
 * Created by lanouhn on 16/9/12.
 */
public class PwdSetting extends AppCompatActivity {
    private boolean flag = false;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pwdsetting_activity);
        findViewById(R.id.edit_head_left_title).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        findViewById(R.id.tv_show_pwd).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!flag) {
                    findViewById(R.id.btn_icon).setBackgroundResource(R.mipmap.icon_check);
                    EditText editText = (EditText) findViewById(R.id.old_pwd);
                    editText.setInputType(InputType.TYPE_TEXT_VARIATION_PHONETIC);
                    EditText new_editText = (EditText) findViewById(R.id.new_pwd);
                    new_editText.setInputType(InputType.TYPE_TEXT_VARIATION_PHONETIC);
                    EditText new_editText2 = (EditText) findViewById(R.id.new_pwd2);
                    new_editText2.setInputType(InputType.TYPE_TEXT_VARIATION_PHONETIC);
                    flag = true;
                } else {
                    findViewById(R.id.btn_icon).setBackgroundResource(R.mipmap.icon_uncheck);
                    EditText editText = (EditText) findViewById(R.id.old_pwd);
                    editText.setInputType(InputType.TYPE_NUMBER_VARIATION_PASSWORD | InputType.TYPE_CLASS_NUMBER);
                    EditText new_editText = (EditText) findViewById(R.id.new_pwd);
                    new_editText.setInputType(InputType.TYPE_NUMBER_VARIATION_PASSWORD | InputType.TYPE_CLASS_NUMBER);
                    EditText new_editText2 = (EditText) findViewById(R.id.new_pwd2);
                    new_editText2.setInputType(InputType.TYPE_NUMBER_VARIATION_PASSWORD | InputType.TYPE_CLASS_NUMBER);
                    flag = false;
                }
            }
        });
    }
}
